-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] - Update exceptions item UI #135255
Conversation
@@ -81,21 +78,13 @@ const ExceptionsViewerItemsComponent: React.FC<ExceptionsViewerItemsProps> = ({ | |||
exceptions.length > 0 && | |||
exceptions.map((exception, index) => ( | |||
<MyFlexItem data-test-subj="exceptionItemContainer" grow={false} key={exception.id}> | |||
{index !== 0 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes the OR
between exception item cards as it no longer appears in new designs.
Pinging @elastic/security-solution (Team: SecuritySolution) |
<div data-test-subj={dataTestSubj}> | ||
{entries.map((entry, index) => { | ||
const { field, type } = entry; | ||
const value = 'value' in entry ? entry.value : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, do we have here any specific reason to use the in
operator and not something like:
const value = entry?.value ?? ''
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's funky because of the typescript union in which a specific property (in this case value
) is not present in all union types, so ?
doesn't solve it in this case. I did try, but typescript still yelled at me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, you're right!
Found this issue
}, [exceptionItem.comments]); | ||
|
||
const disableItemActions = useMemo((): boolean => { | ||
const foundItems = loadingItemIds.filter(({ id }) => id === exceptionItem.id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Because later you check for foundItems.length > 0
maybe better here to use .some
which will return you boolean in the first place
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating!
fieldName="created_by" | ||
label={i18n.EXCEPTION_ITEM_CREATED_LABEL} | ||
value1={ | ||
<FormattedDate fieldName="created_by" value={item.created_at} dateFormat="MM/DD/YY" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we specifically use this format here? As I understand it's US only.)
Also in Kibana Advanced settings, we have Date format - the user can specify how they want present dates, maybe it's better to use this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great point. I updated to not specify so that it should fall back to the users date preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the UI to:
Also, here's an example of what an endpoint exception item looks like. |
Addressed both issues - thanks for finding this @nkhristinin ! bug_fix.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exceptions card looks pleasant now, great work! LGTM!
💔 Build FailedFailed CI StepsMetrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @yctercero |
Summary
Addresses #135254
Updates the exceptions viewer item UI to match new designs. There are still some small aspects missing, but bulk of updated UI is there.
NOTE: There seems to be an existing bug where the field is not populated when selecting to edit an exception item.
Left to do
Existing UI
Checklist